package com.webbei.Backstage.action;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

import com.webbei.Backstage.service.BackstateSer;

public class UpdateLabelCostByMap {
	private Map<Integer,Double> labelprice;
	private int labelId;
	private BackstateSer bao;
	public String execute(){
		Set<Integer> labelcostId = labelprice.keySet();
		Iterator<Integer> iter = labelcostId.iterator();
		bao.deleteLabelconlabelcostByLabelId(labelId);
		while(iter.hasNext()){
			Map<String,Object> m = new HashMap<String, Object>();
			int id = iter.next();
			m.put("labelcostId", id);
			m.put("price", labelprice.get(id));
			m.put("labelId", labelId);
			bao.insertLabelconlabelcostByMap(m);
		}
		return "success";
	}
	
	public Map<Integer, Double> getLabelprice() {
		return labelprice;
	}

	public void setLabelprice(Map<Integer, Double> labelprice) {
		this.labelprice = labelprice;
	}

	public BackstateSer getBao() {
		return bao;
	}

	public void setBao(BackstateSer bao) {
		this.bao = bao;
	}

	public int getLabelId() {
		return labelId;
	}

	public void setLabelId(int labelId) {
		this.labelId = labelId;
	}

}
